/**
 * 
 */
package com.lehecai.core.api.event;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.lehecai.core.api.AbstractApiResultBean;

/**
 * 道具兑换卡
 * @author He Wang
 *
 */
public class PropExchangeCardSummary extends AbstractApiResultBean {
	
	public static final String QUERY_EVENT_ID = "event_id";

	private Long eventId;		   //活动编码
	private String eventName;      //活动名称
	private Integer total;	       //兑换卡总数
	private Integer notinuse;      //未启用
	private Integer available;     //可用
	private Integer used;          //已使用
	private Integer disabled;      //已禁用

	public static PropExchangeCardSummary convertFromJSONObject(JSONObject object) {
		if (object == null) {
			return null;
		}
		PropExchangeCardSummary summary = new PropExchangeCardSummary();
		summary.setEventId(getLong(object, "event_id"));
		summary.eventName = getString(object, "eventName");
		summary.total = getInt(object, "total");
		summary.notinuse = getInt(object, "notinuse");
		summary.available = getInt(object, "available");
		summary.used = getInt(object, "used");
		summary.disabled = getInt(object, "disabled");
		summary.eventName = getString(object, "event_name");
		return summary;
	}
	
	public static List<PropExchangeCardSummary> convertFromJSONArray(JSONArray array) {
		if (array == null) {
			return null;
		}
		List<PropExchangeCardSummary> list = new ArrayList<PropExchangeCardSummary>();
		for (Iterator<?> iterator = array.iterator(); iterator.hasNext();) {
			JSONObject object = (JSONObject) iterator.next();
			list.add(convertFromJSONObject(object));
		}
		return list;
	}

	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	public Long getEventId() {
		return eventId;
	}

	public String getEventName() {
		return eventName;
	}

	public void setEventName(String eventName) {
		this.eventName = eventName;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public Integer getNotinuse() {
		return notinuse;
	}

	public void setNotinuse(Integer notinuse) {
		this.notinuse = notinuse;
	}

	public Integer getAvailable() {
		return available;
	}

	public void setAvailable(Integer available) {
		this.available = available;
	}

	public Integer getUsed() {
		return used;
	}

	public void setUsed(Integer used) {
		this.used = used;
	}

	public Integer getDisabled() {
		return disabled;
	}

	public void setDisabled(Integer disabled) {
		this.disabled = disabled;
	}

}
